<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
	<head>
		<jsp:include page="../inc.jsp"></jsp:include>
		<meta http-equiv="X-UA-Compatible" content="edge" />
		<title>收款结算-支付单号查看详情</title>
		<style>
		 ul,li{
            list-style: none;
        }
        a{
            text-decoration: none;
        }     
        .payInformartion{
			width:1100px;
            height:30px;
           
        }
        .payInformartion li{          
            width:200px;
            line-height: 30px;
            font-size: 14px;         
        } 
       .topmess{
        	padding-left:20px;
        }
        table{
        	border-collapse:collapse;
        	margin:0 auto;
        }
       
        th{
        	height:30px;
        }
        td,th{
			border:1px solid #dedede;
			font-weight: normal;
			text-align: center;
			padding:0 20px;
		}
        .totalText{
        	height:30px;
        	border:1px solid #dedede;
        	
        	line-height:30px;
        	font-family:"微软雅黑";
        	padding-left:50px;
        	
        }
   		.total{
   			display:block;
   			position:relative;
   			top:-30px;
   			left:192px;
   			width:400px;
   			
   			color:red;
   			height:30px;
   			border-left:1px solid #dedede;
   			text-align:center;
   			font-weight:normal;
   		}
		</style>
		
	</head>
	<body style="padding-left:10px;">		    
           <!-- 	<p class='topmess'>支付单号:<span id="pssorderNumber"></span></p>  -->
           <div>
           		<table>
           			<tr>
           				<th>订单号</th>
           				<th>行程</th>
           				<th>订单金额(CNY)/人数</th>
           				<th>可提现金额(CNY)</th>
           				<th>订单状态</th>
           			</tr>
           			
           		</table>
            <!--  
           <div class='totalText'><span>总计</span><b class='total'>￥<span class='totalMoney'></span></b></div>  --> 
           </div>    	
	</body>
	<script>
	$(function(){
		$.ajax({
			type:"get",
			url : '${ctx}/withdrawal/order/${cashNo}?temp='+Math.random(),
			async:true,
			success:function(data){
				var str='';
				//console.log(data)
				var total=0;
				for(var i in data){
					if(data[i].orderStatus =='0'){
						var orderStatus = '待支付'
					}
					if(data[i].orderStatus =='1'){
						var orderStatus = '待审核'
					}
					if(data[i].orderStatus =='2'){
						var orderStatus = '待出票'
					}
					if(data[i].orderStatus =='3'){
						var orderStatus = '出票中'
					}
					if(data[i].orderStatus =='4'){
						var orderStatus = '出票成功'
					}
					if(data[i].orderStatus =='5'){
						var orderStatus = '取消'
					}

					total += data[i].netCash

					//var str = $('<tr><td>平台：'+data[i].orderNumber+'</br>供应商：'+data[i].pssOrderNumber+'</td><td>'+data[i].itineraryList[0].departureDate+'</br>'+data[i].itineraryList[0].departureCity+'&nbsp;('+data[i].itineraryList[0].departureCode+')&nbsp;'+data[i].itineraryList[0].departureTerminal+'&nbsp;---&nbsp;'+data[i].itineraryList[0].arrivalCity+'&nbsp;('+data[i].itineraryList[0].arrivalCode+')&nbsp;'+data[i].itineraryList[0].arrivalTerminal+'</br>'+data[i].itineraryList[1].departureDate+'</br>'+data[i].itineraryList[0].departureCity+'&nbsp;('+data[i].itineraryList[0].departureCode+')&nbsp;'+data[i].itineraryList[0].departureTerminal+'&nbsp;---&nbsp;'+data[i].itineraryList[1].arrivalCity+'&nbsp;('+data[i].itineraryList[1].arrivalCode+')&nbsp;'+data[i].itineraryList[1].arrivalTerminal+'</td><td>'+data[i].unitPrice+'/'+data[i].purchQuantity+'人</td><td>'+data[i].netCash+'</td><td>'+orderStatus+'</td></tr>').appendTo('table');
					//$('.totalMoney').text(total)

					str+='<tr><td>平台：'+data[i].orderNumber+'</br>供应商：'+data[i].pssOrderNumber+'</td><td>'+data[i].itineraryList[0].departureDate+'</br>'+data[i].itineraryList[0].departureCity+'&nbsp;('+data[i].itineraryList[0].departureCode+')&nbsp;'+data[i].itineraryList[0].departureTerminal+'&nbsp;---&nbsp;'+data[i].itineraryList[0].arrivalCity+'&nbsp;('+data[i].itineraryList[0].arrivalCode+')&nbsp;'+data[i].itineraryList[0].arrivalTerminal+'</br>'+data[i].itineraryList[1].departureDate+'</br>'+data[i].itineraryList[0].departureCity+'&nbsp;('+data[i].itineraryList[0].departureCode+')&nbsp;'+data[i].itineraryList[0].departureTerminal+'&nbsp;---&nbsp;'+data[i].itineraryList[1].arrivalCity+'&nbsp;('+data[i].itineraryList[1].arrivalCode+')&nbsp;'+data[i].itineraryList[1].arrivalTerminal+'</td><td>'+data[i].unitPrice+'/'+data[i].purchQuantity+'人</td><td>'+data[i].netCash+'</td><td>'+orderStatus+'</td></tr>';
				}
				str+='<tr style="height:30px;"><td>总计</td><td colspan="4"><b style=color:red;font-weight:normal;>￥&nbsp;</b>'+total+'</td></tr>';
				$("table").append(str);
			}
		});
	});
	</script>
</html>